Spanish deal aimed at forming new government but success far from certain