Swansea defender Ben Davies has signed a contract extension to keep him at the Liberty Stadium until the summer of 2017.