Excitons in a dilute magnetic semiconductor in the presence of an inhomogeneous magnetic field