Bangladesh has signed a deal with Myanmar to return hundreds of thousands of Rohingya Muslims who fled a recent army crackdown.