The French president has tasked Jean Castex with forming a new government after Philippe's resignation, the Elysee says.