Active galactic nuclei as cosmological probes