A US man who was abducted more than two years ago while travelling through Afghanistan as a tourist has been released by the Taliban in a deal with the Trump administration, the State Department said.