Direct determination of quasar redshifts