Planck intermediate results XXV. The Andromeda galaxy as seen by Planck