Massachusetts utility regulators on Monday approved a contract under which a utility will buy half the electricity produced by Cape Wind, the proposed wind farm to be built in Nantucket Sound off the coast of Cape Cod, bringing the project substantially closer to construction.

The decision to allow the sale to National Grid — a British company that owns several utilities in the Northeast, including Massachusetts — comes after a five-month proceeding that involved 23 parties. The decision itself runs 300 pages.

It calls for an initial price of 18.7 cents a kilowatt-hour for electricity produced by the wind farm, far above the wholesale prices that have prevailed recently. But in its decision, the State Department of Public Utilities found that the benefits of the project outweighed the extra cost.

Whether that additional expense will be passed on to consumers is uncertain: if the fiercely contested project qualified for a federal loan guarantee and interest rates were reduced, customers would get three-quarters of the savings through reduced rates. And if construction costs ran lower than anticipated and the company’s rate of return exceeded 10.75 percent, rates would also be reduced.

But under the decision, the charge per kilowatt-hour would increase by 3.5 percent each year, for 15 years, and the company has the option of a 10-year renewal.

How the prices set by the decision will compare to the prevailing price of electricity on New England’s wholesale market depends on a variety of factors that are difficult to predict, including the price of natural gas, the main competing fuel, and the strength of demand for electricity.

The project, if built, could by itself push down the price of electricity during peak hours. The Department of Public Utilities looked at the 10 top hours for electricity demand, and found that if the wind farm had been up and running during those hours, it would have been producing at 76 percent of its capacity. That would tend to tamp down peak prices.

By contrast, onshore wind farms often produce most of their power during off-peak hours, like the middle of the night. Supporters hope that the correlation of offshore wind production with peak demand will help ameliorate the formidable economic challenges of building offshore.

Cape Wind still has to find a buyer for the other half of its output.

“We’re pursuing all options,’’ said Mark Rodgers, a spokesman for Cape Wind, in an e-mail.

When a buyer is found, “we will be back before the D.P.U. for an expedited proceeding,’’ he said.

The company hopes to secure financing in the first half of next year, and to begin construction by the end of 2011.

Ian Bowles, Massachusetts’s secretary of energy and environmental affairs, said that because the utilities board had determined that a sale was cost-effective, “this approval also paves the way for the state’s other utilities and power suppliers to purchase the rest of Cape Wind’s power.’’

He stressed that the state would gain jobs and economic development benefits “that come with being the hub of offshore wind in the United States.’’

The project already has all the required state approvals, but the federal permitting process is not finished.

Other Eastern Seaboard states are also seeking offshore wind development. On Tuesday, Interior Secretary Ken Salazar — joined by Maryland’s governor, Martin O’Malley, and other officials — is expected to make what his department described as a “major announcement” concerning offshore wind. The secretary has been hinting for weeks at a streamlined permitting procedure.