The distribution of dark matter in the halo of M87