Substantial obstacles remain to Brexit deal despite late-night talks