Juncker ‘confident’ of deal to avoid British EU exit