Layered convection induced by phase transitions