The correlation between experimental magnetic field dependences of magnetoresistance and magnetization hysteresis in granular YBa2Cu3O7 is established. Within the proposed approach, magnetoresistance is assumed to be determined by the effective field in the intergrain boundaries the ensemble of which is considered to be a Josephson medium. The effective field in the intergrain medium can be written in the form Beff(H)=H−4πM(H)×α, where α is the parameter of averaged demagnetizing factors of grains and the degree of flux compression. A comparison of experimental magnetoresistance R(H) and magnetization M(H) hysteresis dependences obtained at different external magnetic field sweep rates yields the value α∼10, which is caused by the flux compression between grains. The proposed model describes well most of the features of the magnetoresistance hysteresis in granular high-TC superconductors.