Spain parties strike deal to form government