Aims. We develop a new physical model for the broadband spectral energy distribution (SED) of X-ray illuminated accretion discs, that takes into account the mutual interaction of the accretion disc and the X-ray corona, including all the relativistic effects induced by the strong gravity of the central black hole on light propagation and on the transformation of the photon's energy, from the disc to/from the corona rest-frames, and to the observer. Methods. We assume a Keplerian, optically thick and geometrically thin accretion disc, and an X-ray source in the lamp-post geometry. The X-ray corona emits an isotropic, power-law like X-ray spectrum, with a high-energy cut-off. We also assume that all the energy that would be released by thermal radiation in the standard disc model in its innermost part, is transported to the corona, effectively cooling the disc in this region. In addition, we include the disc heating due to thermalisation of the absorbed part of the disc illumination by the X-ray source. X-ray reflection due to the disc illumination is also included. The X-ray luminosity is given by the energy extracted from the accretion disc (or an external source) and the energy brought by the scattered photons themselves, thus energy balance is preserved. We compute the low-energy X-ray cut-off through an iterative process, taking full account of the interplay between the X-ray illumination of the disc and the resulting accretion disc spectrum which enters the corona. We also compute the corona radius, taking into account the conservation of the photon's number during Comptonization. Results. We discuss in detail the model SEDs and their dependence on the parameters of the system. We show that the disc-corona interaction has profound effects on the resultant SED -it constrains the X-ray luminosity and changes the shape and normalisation of the UV/optical blue bump. We also compare the model SEDs with those predicted from similar models currently available. We use the new code to fit the broad-band SED of NGC 5548, which is a typical Seyfert 1 galaxy. When combined with the results from previous model fits to the optical/UV time-lags of the same source, we infer a high black-hole spin, an intermediate system inclination, and an accretion rate below 10% of Eddington. The X-ray luminosity in this source could be supported by 45-70% of the accretion energy dissipated in the disc. The new model, named KYNSED, is publicly available to be used for fitting AGN SEDs inside the XSPEC spectral analysis tool. Conclusions. X-ray illumination of the accretion disc in AGN can explain both the observed UV/optical time-lags as well as the broad band SED of at least one AGN, namely NGC 5548. A simultaneous study of the optical/UV/X-ray spectral/timming properties of those AGN with multi-wavelength, long monitoring observations in the last few years, will allow us to investigate the X-ray/disc geometry in these systems, and constrain their physical parameters.