Virginia Gov. John N. Dalton acknowledged yesterday that he had approved a lucrative state contract with a Richmond law firm this spring shortly after the firm had offered him a partnership.

The Republican governor, responding to conflict-of-interest charges by Democrats, said he retained the firm of McGuire, Woods and Battle to defend the state's contested reapportionment plan at the request of Democratic legislative leaders.

On May 1, a few weeks after the law firm was selected, Dalton announced his decision to join it when he leaves office in January.

"I'm surprised that I'm getting criticism for this when the suggestion came from the other side of the aisle," Dalton said at a news conference in Richmond yesterday. "I told [them] that I had been offered a position in that firm . . . [and] I was told by [State Senate Majority Leader] Hunter Andrews in the presence of everyone else in the room that he saw nothing wrong with it."

But Andrews, a Hampton Democrat, said yesterday that Dalton did not mention the offer from the Main Street firm, one of the largest in Virginia, at his April 1 meeting with the General Assembly leaders.

"He said at that time that he had contemplated going with a law firm in Richmond and that he might go with this firm, but he didn't tell us they had made him an offer," Andrews said. "We didn't know the governor was going to announce anything."

Dalton's decision to bypass Attorney General J. Marshall Coleman's office and hire an outside legal firm drew fire yesterday from Democratic state Sens. Dudley J.Emick of Fincastle and Daniel Bird of Wytheville, who said the decision could cost taxpayers up to $500,000.

"There is an appearance of impropriety in that the governor picked this particular law firm," said Emick. "I'm not accusing the governor or the law firm of impropriety, but like Caesar's wife you ought to avoid even the appearance of impropriety."

The Richmond firm will have to defend the state from four separate lawsuits challenging the constitutionality of the General Assembly's recent action reapportioning its 100 House seats. The suits alleged that the legislators ignored court guidelines for equal representation by establishing House districts with widely varying populations.

Both Dalton and Robert H. Paterson Jr., a senior partner in the firm, rejected the charges that the arrangement had been improper, and said the firm had been chosen because of its prior experience in representing the state in contested election cases.

McGuire, Woods was retained by Virginia's Board of Elections in 1978 when the results of the senatorial race between John W. Warner and Andrew P. Miller were challenged, and again in 1979 when a defeated state senatorial candidate contested election results in Tidewater.

"Our representation of the State Board of Elections has absolutely nothing to do with Gov. Dalton joining our law firm," said Patterson. "I'd like to put your mind to rest on that point."

Dalton had said earlier that he did not turn the reapportionment case over to the attorney general's office because it involves partisan political issues that should not be handled by Coleman, who is the Republican nominee for governor and is highly unpopular with Democratic legislators.

Emick and Bird argued, however, that any of dozens of other lawyers in Coleman's office could handle the case without suggestions of political bias. Ten years ago, when the state last redrew its political districts, lawyers in the state attorney general's office provided all of the state's legal representation in both state and federal courts.

Anthony Troy of Richmond, a former state attorney general who worked on the reapportionment case in 1971, said yesterday that the state did not advertise for public bids on legal representation."I let it be known to certain people that if they were looking for an outside attorney. I'd be interested in it," Troy, a Democrat, said. "But they never called me."