The contribution of quasars to the ultraviolet extragalactic background