The 49ers have signed Ian Williams to a two-year contract extension through the 2015 season.