This paper presents a control strategy for the optimization of artificial lift systems (ALS) with electrical submersible pumping (ESP), executing a nonlinear model-based predictive control (NMPC) to manipulate the operating frequency of the pump and control the flow rate through the well, including specific restrictions over the system and considering its present and future behavior. The controller was designed according to a practical approach, considering the field implementation limitations and requirements. It provides significant efficiency and safety features, maximizing the revenue and operating the system in the optimal range, while respecting the system constraints and taking into account its predicted behavior. The control proposal includes the system modelling and its dynamic identification, the design of the NMPC controller, and its configuration and tuning in a simulation environment. The results of the simulation of the control system performance for an existing well are shown.