The luminosity function of high-redshift quasi-stellar objects. A combined analysis of GOODS and SDSS