Joint search for isolated sources and an unresolved confusion background in pulsar timing array data