Measurement of Inelastic J/psi and psi' Photoproduction at HERA