49ers re-sign Carlos Rogers, defense stays intact

One of the NFL’s most dominant defenses will remain intact for another season.

Cornerback Carlos Rogers, the 11th and final piece to the puzzle, signed a four-year, $31.3 million contract Tuesday to stay in San Francisco, the NFL Network reported.

With Rogers returning, the Niners will have all 11 starters back from a defense that ranked second in points allowed and fourth in total yards during last year’s 13-3 season. In 2012, Rogers will come in particularly handy: San Francisco will face the top five quarterbacks in passing yardage from last year, a quintet that includes Green Bay’s Aaron Rodgers, New England’s Tom Brady and New Orleans’ Drew Brees.

In his first season in San Francisco, Rogers, the ninth overall pick in the 2005 draft, had a career-high six interceptions and earned his first Pro Bowl berth. Rogers, who will turn 31 in July, said after the season he was seeking a four- or five-year contract.

Earlier in the day, signs suggested that Rogers might not remain in San Francisco.

A few hours before free agency began Tuesday afternoon, the Niners signed former Broncos cornerback Perrish Cox. After the free agency kicked off, they were reportedly pursuing Lions cornerback Eric Wright and Chiefs cornerback Brandon Carr.

With Rogers and Tarell Brown locked into starting spots, Cox will settle into a backup role after sitting out last year. A fifth-round pick of the Broncos in 2010, Cox was released by the team following his arrest in December 2010 on felonious sexual assault charges. Cox was acquitted of those charges this month.

In a statement, general manager Trent Baalke indirectly addressed the questions Cox’s signing were sure to inspire. Baalke said the team did its “due diligence” and was confident Cox would be a “positive contributor to the 49ers, as well as our community.”

At Oklahoma State, Cox was a finalist for the Thorpe Award given the nation’s top defensive back and finished his career with the third-most kickoff return yards in FBS history.

“That’s not me,” Cox said of the sexual-assault charges. “I’m not that type of guy. To prove that, I’ll show the community and the coaches and the team what type of guy I am and can be. From here on out, I’ll show it.”

Also on the first day of free agency:

— Former 49ers wide receiver Joshua Morgan signed a five-year contract with the Redskins. The first three years of Morgan’s deal could be voided, but it is worth $12 million over the first two years, with $7.5 million guaranteed.

— Blake Costanzo, 27, a special-teams standout in 2011, signed a two-year contract with the Bears. Costanzo, who ranked second on the team with 17 special-teams tackles, did not receive a contract offer from San Francisco.

“They’ve had some of the top special teams in the league, too, so we’ve been in contact with them,” Costanzo said in a phone interview with The Chronicle. “They made me an offer and wanted to make me part of their team for the next couple of years. It was a good opportunity for me and my family. I decided to jump on it.”

— The 49ers signed inside linebacker Tavares Gooden, 27, to a one-year contract. Gooden ranked third on the team with 12 special-teams tackles last year. He is the team’s only backup inside linebacker under contract behind Patrick Willis and NaVorro Bowman.