This paper investigates the UAV-enabled wireless powered cooperative mobile edge computing (MEC) system, where a UAV installed with an energy transmitter (ET) and an MEC server provides both energy and computing services to sensor devices (SDs). The active SDs desire to complete their computing tasks with the assistance of the UAV and their neighboring idle SDs that have no computing task. An optimization problem is formulated to minimize the total required energy of UAV by jointly optimizing the CPU frequencies, the offloading amount, the transmit power and the UAV's trajectory. To tackle the non-convex problem, a successive convex approximation (SCA)based algorithm is designed. Since it may be with relatively high computational complexity, as an alternative, a decomposition and iteration (DAI)-based algorithm is also proposed. Simulation results show that both proposed algorithms converge within several iterations, and the DAI-based algorithm achieves the similar minimal required energy and optimized trajectory with the SCA-based one. Moreover, for a relatively large amount of data, the SCA-based algorithm should be adopted to find an optimal solution, while for a relatively small amount of data, the DAI-based algorithm is a better choice to achieve the smaller computing energy consumption. It also shows that the trajectory optimization plays a dominant factor in minimizing the total required energy of the system and optimizing acceleration has a great effect on the required energy of the UAV. Additionally, by jointly optimizing the UAV's CPU frequencies and the amount of bits offloaded to UAV, the minimal required energy for computing can be greatly reduced compared to other schemes. And, by leveraging the computing resources of idle SDs, the UAV's computing energy can also be greatly reduced.