Mobile edge computing (MEC) is a new paradigm to improve the quality of vehicular services by providing computation offloading close to vehicular terminals (VTs). However, due to the computation limitation of the MEC servers, how to optimally utilize the limited computation resources of MEC servers while maintaining a high quality of experience (QoE) of VTs becomes a challenge. To address the problem, we investigate a novel computation offloading scheme based on the MEC offloading framework in vehicular networks. Firstly, the utility of VTs for offloading their computation tasks is presented, where the utility is jointly determined by the execution time, computation resources and the energy for completing the computation tasks. Next, with the theoretical analysis of the utility, the QoE of each VT can be guaranteed. Then, combined with the pricing scheme of the MEC servers, we propose an efficient distributed computation offloading algorithm to make the optimal offloading decisions for VTs, where the utility of the MEC servers is maximized and the QoE of the VTs is enhanced. In addition, simulation results demonstrate that the proposal can lead to a higher utility for MEC servers than the conventional schemes.