The quick growth of energy consumption in urban rail transit has drawn much attention due to the pressure of both operational cost and environmental responsibilities. In this paper, the timetable is optimized with respect to the system cost of urban rail transit, which pays more attention to energy consumption. Firstly, we propose a Mixed-Integer Non-Linear Programming (MINLP) model including the non-linear objective and constraints. The objective and constraints are linearized for an easier process of solution. Then, a Mixed-Integer Linear Programming (MILP) model is employed, which is solved using the commercial solver Gurobi. Furthermore, from the viewpoint of system cost, we present an alternative objective to optimize the total operational cost. Real Automatic Fare Collection (AFC) data from the Changping Line of Beijing urban rail transit is applied to validate the model in the case study. The results show that the designed timetable could achieve about a 35% energy reduction compared with the maximum energy consumption and a 6.6% cost saving compared with the maximum system cost.