Interaction between molecular impurities trapped in rare gas crystals. I. Effective potential calculations