Context. Methane is among the main components of the ice mantles of insterstellar dust grains, where it is at the start of a rich solid-phase chemical network. Quantification of the photon-induced desorption yield of these frozen molecules and understanding of the underlying processes is necessary to accurately model the observations and the chemical evolution of various regions of the interstellar medium. Aims. This study aims at experimentally determining absolute photodesorption yields for the CH4 molecule as a function of photon energy. The influence of the ice composition is also investigated. By studying the methane desorption from layered CH4:CO ice, indirect desorption processes triggered by the excitation of the CO molecules is monitored and quantified. Methods. Tunable monochromatic VUV light from the DESIRS beamline of the SOLEIL synchrotron is used in the 7 - 13.6 eV (177 - 91 nm) range to irradiate pure CH4 or layers of CH4 deposited on top of CO ice samples. The release of species in the gas phase is monitored by quadrupole mass spectrometry and absolute photodesorption yields of intact CH4 are deduced. Results. CH4 photodesorbs for photon energies higher than ~9.1 eV (~136 nm). The photodesorption spectrum follows the absorption spectrum of CH4, which confirms a desorption mechanism mediated by electronic transitions in the ice. When it is deposited on top of CO, CH4 desorbs between 8 and 9 eV with a pattern characteristic of CO absorption, indicating desorption induced by energy transfer from CO molecules. Conclusions. The photodesorption of CH4 from the pure ice in various interstellar environments is around 2.0 x 10^-3 molecules per incident photon. Results on CO-induced indirect desorption of CH4 provide useful insights for the generalization of this process to other molecules co-existing with CO in ice mantles.