  In this paper we study the impact of a recent quasar datasample in the
constraint of the free parameters of an extension of general relativity. As a
ruler to test, we use Rastall gravity in the context of background cosmology
being a simple extension to general relativity. We compare the results from
quasars dataset with other known samples such as cosmic chronometers,
supernovae of the Ia type, baryon acoustic oscillations, HII galaxies, and also
a joint analysis. Results are consistent with the standard cosmological model
emphasizing that Rastall gravity is equivalent to General Relativity. According
to the constraints provided from the joint sample, the age of the Universe is
$\tau_U = 12.601^{+0.067}_{-0.066}$ Gyrs and the transition to an accelerated
phase occurs at $z_T=0.620\pm0.025$ in the redshift scale, being only the phase
transition consistent with the standard paradigm and having a younger Universe.
With the quasars sample, the universe age differs with that expected in
$\Lambda$CDM having a result of $\tau_U = 11.958^{+0.139}_{-0.109}$ Gyrs with a
transition at $z_T=0.652\pm0.032$ this last consistent with standard cosmology.
A remarkable result is that quasars constraints has the capability to
differentiate among general relativity and Rastall gravity due to the result
for the parameter $\lambda=-2.231^{+0.785}_{-0.546}$. Moreover, the parameter
$j$ under quasars constraints suggests that the cause of the late universe's
acceleration is a dark energy fluid different from a cosmological constant.
