David Cameron has said the rest of the EU wants to have the "closest possible" relationship with the UK after Brexit.