The 49ers have agreed to a two-year deal with kicker Phil Dawson.