Bayern Munich defender Jerome Boateng has signed a three-year contract extension to keep him at the club until 2018.