Multi-access edge computing (MEC) is a promising technique to improve computation capabilities of mobile devices, and non-orthogonal multiple access (NOMA) can be combined with it to improve the spectral efficiency. This paper aims to minimize the energy consumption of a NOMA-assisted MEC system by optimizing the power allocation and task assignment. The original formulated problem is non-convex. To efficiently solve it, we decompose it into three stages, i.e., power allocation, time slot scheduling, and offloading task assignment, which are solved optimally by carefully studying their convexity and monotonicity. The optimal power expressions are obtained by solving the first problem. Subsequently, an additional time slot, which is occupied by OMA transmission, can be optimized by analyzing the monotonicity of the second problem. Finally, the offloading strategy coefficient, which decides the amount of data to be offloaded to the base station (BS) and the remaining data computed locally, is obtained optimally. The derived solution is optimal to the original problem by substituting the closed expressions obtained from those decomposed problems. Simulation results are provided to verify the superior performance of the proposed scheme compared with some benchmarks, i.e., OMA and the existing work.