Dependence of the exchange splitting in excitons on the interatomic distance