Russia and Iran signed a new treaty underpinning their economic and military cooperation, in what both sides cast as a major milestone in their relations.