David Davis has resigned from his post as Brexit secretary with a letter describing himself as a "reluctant conscript" to Theresa May's leadership.