EasyJet has agreed to buy part of Air Berlin's operations at Berlin Tegel airport.