Shining lights, even in death: modelling the optical and ultraviolet emission from tidal disruption events