The uninterrupted measurement of the total solar irradiance during the last three solar cycles and an increasing amount of solar spectral irradiance measurements as well as solar imaging observations (magnetograms and photometric data) have stimulated the development of models attributing irradiance variations to solar surface magnetism. Here we review the current status of solar irradiance measurements and modelling efforts based on solar photospheric magnetic fields. Thereby we restrict ourselves to the study of solar variations from days to the solar cycle. Phenomenological models of the solar atmosphere in combination with imaging observations of solar electromagnetic radiation and measurements of the photospheric magnetic field have reached high enough quality to show that a large fraction (at least, about 80%) of the solar irradiance variability can be explained by the radiative effects of the magnetic activity present in the photosphere. Also, significant progress has been made with magnetohydrodynamic simulations of convection that allow us to relate the radiance of the photospheric magnetic structures to the observations.