A scenario-based optimization framework associated with voltage control in the electric networks with wind farms connected has been proposed in the paper. The optimization process corresponds to the Optimal Power Flow (OPF) problem, where the reduced gradient method, characterized by a fast convergence (few iterations), has been used. The proposed framework allows the network operator to maintain a constant voltage level in the nodes and reduce energy losses. Testing in a test 10-bus network demonstrated the efficiency of the proposed framework for all considered scenarios referring to the generation profiles and the operating regimes of two wind farms connected. The results revealed the high potential of the proposed framework to help the network operators in the voltage control from the electric networks with wind farms connected, mitigating the voltage variations at the buses from values located in the range [0.05, 0.09] p.u. to [0.004, 0.007] p.u. and also highlighted the advantages of this approach in reducing energy losses quantified through the energy-savings with values between 18% and 42% compared with the initial operating regime.