Four councils sharing legal services to save £1 million a year