Atmospheric neutrinos are produced during cascades initiated by the interaction of primary cosmic rays with air nuclei. In this paper, a measurement of the atmospheric energy spectrum in the energy range 0.1-200 TeV is presented, using data collected by the ANTARES underwater neutrino telescope from 2008 to 2011. Overall, the measured flux is similar to 25 % higher than predicted by the conventional neutrino flux, and compatible with the measurements reported in ice. The flux is compatible with a single power-law dependence with spectral index gamma (meas)=3.58 +/- 0.12. With the present statistics the contribution of prompt neutrinos cannot be established.