Changes in the conformation and electronic structure of molecules upon phase transitions in a uniaxial liquid crystal