Australian Deputy Prime Minister Barnaby Joyce says he will resign as leader of his party and will move to the backbench after weeks of pressure over an extra-marital affair with his former media secretary.