In this paper, we discuss the problem of optimally designing the layout of a given number of photovoltaic arrays on a flat polygonal surface, in order to maximize a suitable objective function, e.g., the total generated energy. This means finding their optimal position, azimuth and tilt. The considered problem becomes non-trivial when considering effects such as irradiance variability and self-shadowing. We first provide a description of the system model and the associated optimization problem, showing how the resulting formulation presents non-convexities. Then, we provide a tight parametrized convex relaxation, which is computationally tractable and for which optimality conditions hold. We provide numerical simulations using realistic data, showing how the proposed methodology yields near-optimal solutions in lower computational time with respect to the traditional global resolution approach.