Taiwanese protesters who have occupied parliament for three weeks in protest at a trade agreement with China said they would leave on Thursday evening.