Theoretical description of nuclear quadrupole coupling in light diatomic molecules