We present a study of the relation between X-rays and ultraviolet emission in quasars for a sample of broad-line, radio-quiet objects obtained from the cross-match of the Sloan Digital Sky Survey DR14 with the latest Chandra Source Catalog 2.0 (2,332 quasars) and the Chandra COSMOS Legacy survey (273 quasars). The non-linear relation between the ultraviolet (at 2500 A, $L_{O}$) and the X-ray (at 2 keV, $L_{X}$) emission in quasars has been proved to be characterised by a smaller intrinsic dispersion than the observed one, as long as a homogeneous selection, aimed at preventing the inclusion of contaminants in the sample, is fulfilled. By leveraging on the low background of Chandra, we performed a complete spectral analysis of all the data available for the SDSS-CSC2.0 quasar sample (i.e. 3,430 X-ray observations), with the main goal of reducing the uncertainties on the source properties (e.g. flux, spectral slope). We analysed whether any evolution of the $L_{X}-L_{O}$ relation exists by dividing the sample in narrow redshift intervals across the redshift range spanned by our sample, $z simeq 0.5-4$. We find that the slope of the relation does not evolve with redshift and it is consistent with the literature value of $0.6$ over the explored redshift range, implying that the mechanism underlying the coupling of the accretion disc and hot corona is the same at the different cosmic epochs. We also find that the dispersion decreases when examining the highest redshifts, where only pointed observations are available. These results further confirm that quasars are `standardisable candles, that is we can reliably measure cosmological distances at high redshifts where very few cosmological probes are available.