We observed a slow relaxation of magnetoresistance in response to applied magnetic field in selectively doped p-GaAs-AlGaAs structures with partially filled upper Hubbard band. We have paid a special attention to exclude the effects related to temperature fluctuations. Though this effect is important, we have found that the general features of slow relaxation still persist. This behavior is interpreted as related to the properties of the Coulomb glass formed by charged centers with account of spin correlations, which are sensitive to an external magnetic field. Variation of the magnetic field changes numbers of impurity complexes of different types. As a result, it effects the shape and depth of the polaron gap formed at the states belonging to the percolation cluster responsible for the conductance. The suggested model explains both the qualitative behavior and the order of magnitude of the slowly relaxing magnetoresistance.