Momentum spectra of protons from Be and C in high-energy reactions with quasi-monochromatic photons