Planck intermediate results: XXV. the Andromeda galaxy as seen by Planck