The UK parliament has approved Prime Minister Theresa May's plan to request an extension to delay Brexit until June 30.