TEANECK, N.J., FEB. 13 -- The legal parents of Baby M have agreed to seek an out-of-court settlement on visitation rights for surrogate mother Mary Beth Whitehead Gould, and she has agreed to begin using the name they chose for the child, her lawyer said today.

"We had suggested that it's time for a healing process to take place and for the adults to do what's right for the child," attorney Harold Cassidy said at a luncheon to discuss the Baby M case at Fairleigh Dickinson University.

"Mary Beth accepts the fact that she will not have total custody . . . and agrees to call the child Melissa," the name given by her natural father, William Stern, and his wife, Elizabeth, Cassidy said.

The Sterns won custody of Melissa Stern, known in court papers as Baby M, in a landmark court battle that ended last March. Their right to retain custody was upheld in a decision earlier this month by the New Jersey Supreme Court.

The state's high court rejected their surrogate motherhood contract as unenforceable but decided that William Stern should keep custody on the grounds that he would provide a better home.

However, the court rejected a portion of the lower court ruling stripping Gould of visitation rights, saying an agreement on that matter should be relitigated at the lower court.

The Sterns initially reacted angrily to the visitation-rights ruling, saying they no longer wanted Gould involved in their efforts to raise the 22-month-old girl whom Gould insisted on calling Sara.

"After much soul-searching," the Sterns decided it was in the child's best interest that they seek an amicable settlement with Gould, lawyer Gary Skoloff said in a statement.

The Sterns "invite discussions {on visitation rights} as long as they are private and never disclosed publicly," Skoloff said.

No date has been set for the negotiations, Cassidy and Skoloff said.

Meanwhile, ABC-TV announced that it will make a television film tentatively titled "Baby M." The film, based on trial transcripts, is scheduled for spring release, the network said.