The increasing of the energy demand in every country has lead experts to find strategies for estimating the energy demand of a given country for the next year. The energy demand prediction in the last years has become a hard problem, since there are several factors (like economic crisis, industrial globalization, or population variation) that are not easy to control. For this reason, it is interesting to propose new strategies for efficiently perform this estimation. In this paper we propose a metaheuristic algorithm based on the Variable Neighborhood Search framework which is able to perform an accurate prediction of the energy demand for a given year. The algorithm is supported in a previously proposed exponential model for estimating the energy, and its input is conformed with a set of macroeconomic variables gathered during the last years. Experimental results show the excellent performance of the algorithm when compared with both previous approaches and the actual values.