As Menachem said,
\begin{equation}
\mu(M) = \int_M \frac{ds}{|\nabla H|},
\end{equation}
is a good answer.
Now I want to give a more abstract answer $\mu_E$ with surface element $d\sigma$ that will be described below.
Consider N particles with phase space measure $d\tau=dq_1...dq_N dp_1...dp_N$
Let $d\sigma$ be a measure on energy surface such that $d\sigma dE=d\tau$. Call the measure $\mu_E$, so $\mu_E(V)=\int_{V\cap \Sigma_E} d\sigma$. Here, $\Sigma_E$ is the energy surface and V is any phase space volumn. We can then prove such surface measure is hamiltonian-flow-invariant.
Let $\phi_t()$ be the hamiltonian flow ( ie, a time evolution of initial state $\tau_0$ is $\phi_t(\tau_0)$ ). By Liouvill's Theorem, $d\tau$ is hamiltonian-flow-invariant.
$$ \int_V d\tau =\int_{\phi_t(V)} d\tau $$
Now cut $V$ be between $E$ and $E+\Delta E$ and only keep the shell.
$$ \int_{E}^{E+\Delta E} \int_{V \cap \Sigma_{E'}} dE'd\sigma = \int_{E}^{E+\Delta E} \int_{\phi_t(V) \cap \Sigma_{E'}} dE'd\sigma$$
This holds true for any $E$ and $\Delta E$ that we choose (because of conservation of energy). Now we substitute the definition of $\mu_E(V)$ and $\mu_E(\phi_t(V))$
$$ \int_{E}^{E+\Delta E} dE' \mu_{E'}(V) = \int_{E}^{E+\Delta E} dE' \mu_{E'}(\phi_t(V))$$
Since this holds true for any $E$ and $\Delta E$, we divide both sides by $1/\Delta E$, fix E, then take $\Delta E$ to approach zero.
We get
$$ \mu_{E}(V)=\mu_E(\phi_t(V)) $$
The above derivation shows if we can construct a $d\sigma$ such that $d\sigma dE=d\tau$, then the construction is flow-invariant.
Now we show the measure Menachem wrote, $(ds/ |\nabla H| )$, does satisfy $(ds/ |\nabla H|) \ dE= d\tau $. Since $ds\ dh=d\tau$, where $dh$ is the height of the volume element in phase space, we want to show $dh=dE/ |\nabla H|$ or $dh |\nabla H|=dE$, and this is almost the definition of derivative. (If we consider $\vec{dh}$ as a vector on the phase space normal to the energy surface, then $dE=\vec{\nabla} H \cdot \vec{dh}=|\nabla H| dh$ )
In the forward direction, $dh |\nabla H|=dE$ -> $dE/|\nabla H|=dh$ -> $dE/|\nabla H|\ ds=dh\ ds=d\tau$ -> $(ds/|\nabla H|)\ dE=d\tau$. By the previous derivation $ds/|\nabla H|$ gives a flow invariant measure.