Distribution system networks (DSN) are subject to a drastic evolution in their operation conditions, due to high integration of renewable energy resources (RES) and their ability to regulate the voltage. This has raised concerns about Hosting Capacity (HC) of the DSN because the results are affected by the reactive power provided by smart inverters or RES. Moreover, one of the most difficult issues in control and optimization is making effective use of the reactive power capability of smart inverters in reactive power control. Offline optimization of smart inverters may not be enough to address the critical challenges posed by high PV integration. This study investigates the effect of PVs' reactive power support on the DSN to minimise active power losses and control system voltage. An HC analysis is performed on a DSN that lacks any RES to determine the location and capacity of the PV system to be installed. To minimise losses, a co-simulation-based optimization of the reactive power of the PVs' smart inverters is performed downstream the installation. Using co-simulation, detailed mathematical modelling of the DSN in the optimization model can be avoided, allowing the optimization to be completed in less time while maintaining convergence. Faster optimization builds a foundation for using the proposed methodology in real-time optimal reactive power control in a smart distribution network.