UBVR photometry of a sample of B3-VLA radio quasars, about 80 per cent complete, is used to analyse their spectral energy distribution (SED). The SEDs are generally well fitted with power-laws, with an average slope alpha=-0.39 (S_nu propto nu^alpha). Two quasars appear clearly differenciated, exhibiting redder colours that the rest, and they have redshifts z=0.50 and 1.12. Broad-band composite SEDs in the range 1300-4500 AA were obtained from the remaining quasars and they show the CIV1549 line and a break at around 3000 A, where the SED changes from alpha_blue=0.11+-0.16 at lambda>3000 A to alpha_UV=-0.66+-0.15 at lambda<3000 A. The continuum shape depends on redshift. For the quasars with z<1.2 we find alpha_blue=0.21+-0.16 and alpha_UV=-0.87+-0.20, and for z>1.2 alpha_UV is more flat, -0.48+-0.12. A similar trend is found between alpha_UV and luminosity at 2400 A, L_2400, with luminous quasars exhibiting a bluer spectrum. In addition, an intrinsic correlation is found between L_2400 and radio power at 408 MHz. The correlations alpha_UV-z, alpha_UV-L_2400 and L_2400-z are consistent with accretion disc models with approximately constant black hole mass and accretion rates increasing with redshift. If the trends L_2400-z and P_408-z are predominantly related to the radio-flux limits of the sample, only one of the correlations alpha_UV-L_2400 or alpha_UV-z needs to be intrinsic.