Conditions on the occurrence of magnetic moments in quasicrystals and related phases