Perovskite solar cells with record efficiencies already above 24% are a highly promising clean energy technology. However, the reproducibility in their fabrication has proven to be challenging and needs more attention. Here we demonstrate that surface activation of the mesoscopic titanium dioxide (TiO2) scaffold, utilized in the two-step perovskite synthesis process, significantly affects the final device performance. Irradiating the mesostructured substrate with ultraviolet (UV) light prior to lead iodide (PbI2) deposition has a positive effect on the short-circuit current density and on the overall device performance (leading to a >20% increase in efficiency in our devices). As most of the UV light is absorbed in the topmost TiO2 layer, the interior of the scaffold remains less activated. This results in a sparsely packed PbI2 structure that facilitates an efficient conversion to the perovskite, while the activated topmost surface improves the perovskite capping layer. On the contrary, plasma treatment of the scaffold also activates the interior parts of the scaffold, which leads to a dense PbI2 structure that hampers the conversion and causing a >25% efficiency drop. We show that also minor changes in the surface properties of the mesoporous TiO2 scaffold can affect the device performance, which could explain some of the large efficiency variations observed between laboratories.