Spain's government has announced $36 billion of tax rises and spending cuts as it tries to avoid a bailout.