This paper deals with optimal reinsurance problem and involves goals of both insurer and reinsurer. An important novelty may be incorporation of background risk that reinsurer uses in order to diversify (or hedge) risk ceded by insurer. Accordingly, general methods to prevent reinsurer moral hazard must be extended, and a new constraint must be satisfied by selected reinsurance contract, namely, the reinsurer increment of risk must be lower than contract premium. Simultaneously, since contract must be attractive to insurer too, the contract premium must be lower than insurer risk reduction. Integrating both ideas, the contract premium must be higher than reinsurer risk growth and lower than insurer risk mitigation. Bearing in mind both requirements, that is, protection against moral hazard and spread containing contract premium, optimal reinsurance problem is studied under very general conditions about involved risk measures and premium principles, general solutions are provided, and a practical illustrative example is presented.