In this article we investigate the problem of generating electricity through an underwater kite power system (UKPS). For this problem, we develop the dynamical model for the UKPS and we formulate an optimal control problem to devise the trajectories and controls of the kite that maximize the total energy produced in a given time interval. This is a highly nonlinear problem for which the optimization is challenging. We also develop a numerical solution scheme for the optimal control problem based on direct methods and on adaptive time-mesh refinement. We report results that show that the problem can be quickly solved with a high level of accuracy when using our adaptive mesh refinement strategy. The results provide a set of output power values for different design choices and confirm that electrical energy that can be produced with such device.