The Beverly Hills lawyer who represented two women who were paid in 2016 to keep quiet about their alleged affairs with Donald J. Trump has been drawn into the federal investigation focused on Michael D. Cohen, Mr. Trump’s longtime lawyer and fixer.

That lawyer, Keith M. Davidson — who finalized another legal agreement with Mr. Cohen in recent months — was contacted by federal authorities in the wake of this month’s raid on Mr. Cohen’s Manhattan office and has shared records with investigators, a spokesman said.

“Mr. Davidson has been contacted by the federal authorities regarding the Michael Cohen probe in the Southern District of New York,” the spokesman, Dave Wedge, said on Friday. “Mr. Davidson was asked to provide certain limited electronic information. He has done so and will continue to cooperate to the fullest extent possible under the law.”

Mr. Davidson has reached multiple agreements with Mr. Cohen — one of them negotiated in late 2017, when the men brokered the silence of a Playboy model who had had an affair with a major Republican donor and Trump ally. Mr. Cohen also referred business to Mr. Davidson after their earlier dealings leading up to the 2016 presidential election.