Multiple-input multiple-output (MIMO) systems perform well from the energy efficiency (EE) and the spectral efficiency (SE) points of view in fifth generation (5G) communication systems. This paper considers the operation of a MIMO system with a relay. The optimization problem relates to the EE maximization. This problem has two types of limitations, which provide a maximum transmission power and a minimum data rate for users. The encountered objective function is in a fractional form and thus it is a nonconvex function. Besides, the problem is constrained. We utilize a lower bound analysis for the data rates, some properties of the linear programming, and the maximum ratio transmission (MRT) precoding scheme to obtain a convex objective function. Using the Lagrange dual function, we obliterate the constraints of the problem and then it is easy to solve. To improve system performance, users are divided into two groups based on their channel gains, and the maximum transmission power is reasonably divided between them. Two iterative algorithms are proposed to solve the optimization problem numerically, and finally we investigate performance of the proposed method.