Supernova neutrino spectrum with matter and spin flavour precession effects