The virtual photon–gluon impact factor with massive quarks and exact gluon kinematics