The global farming sector has a big role to play in the effort to curb greenhouse gas emissions and adapting to future climate change, the UN says.