The LOFAR Two-metre Sky Survey Deep Fields -- Data Release 1: IV. Photometric redshifts and stellar masses