The United Nations and Brazil have signed a US$20m agreement to support cotton farmers in developing countries.