Phase transitions in the electroweak theory at finite temperature and density