Spain’s socialists reach controversial deal with Catalan separatists for government backing