We present an iterative method to model the optical properties of a complete semitransparent perovskite solar cell. It is based on spectroscopic characterizations and accounts for porosity and incoherence effects. We provide the complex refractive indices of each layer, and we identify the main sources of optical losses. The optical model is also coupled to an electrical model of 4T perovskite/silicon tandem solar cells. It allows to evaluate the interplay between the optical and electrical losses, and the balance between the efficiency of the top and bottom cells. These models provide an effective way to design future tandem devices.