Simple liquids confined to molecularly thin layers. I. Confinement-induced liquid-to-solid phase transitions