The two countries sign a 20-year treaty covering areas ranging from defence and technology to energy and trade.