Modelling total solar irradiance since 1878 from simulated magnetograms