Preferential population of magnetic sublevels of photodissociated atoms. Photodissociation of alkali-metal dimers and the effect of magnetic field