The 49ers gave head coach Kyle Shanahan a new six-year contract that will keep him in San Francisco through 2025.