Modelling of nematic liquid crystals in electromagnetic fields