AMENDED AND RESTATED INTERMEDIATE PIPELINES AGREEMENT