The redshift-magnitude relation for quasi-stellar objects