Neutrino spin dynamics in dense matter and electromagnetic field