Rising oil imports widened the nation's trade deficit in September to an unexpectedly high $2.8 billion, the largest increase since last January, the Commerce Department reported yesterday.

The total cost of importing oil climbed 12 percent in September, partially because of a 6 percent rise in imports over August. OPEC's continuing price increases made up the rest of the cost to U.S. oil buyers.

The volume of oil imports hit 261 million barrels, the highest level since April. Since demand for gasoline and other refined products generally is running well below a year ago, analysts said some of the oil is being imported to build up inventories.

Even with the higher level of imports, the nation is still considerably below the 8.2-million-barrel a day limit on net oil imports decreed by President Carter.

Meanwhile, the index of leading economic indicators, which often foreshadows changes in the economy, rose a strong 0.8 percent in September, the department also reported.

Despite this apparently contrary sign most forecasters still expect the economy to slump again soon and they discounted the importance of the news. "It doesn't change my perception that the economy will be flat, at best, in coming months," said one Commerce economist.

More in line with that expectation, another report showed that contracts for new construction of housing and other structures dropped last month from September 1978, the third month in a row that has happened.

Digesting all this news, and helped along by some modest declines in short-term interest rates, the stock market turned in its best day in weeks. The Dow-Jones Industrials average closed at 823.81, up 15.19 points.

The market had fallen sharply since the Federal Reserve announced a series of actions Oct. 6 that led to major increases in short-term interest rates.

The increased trade deficit was not welcome news to Carter administration officials hoping to keep the dollar stable on foreign exchange markets. But, unpredictable as usual, the markets paid little attention to the wider deficit, with the dollar rising strongly against the Japanese yen and the British pound and showing little change against other currencies.

For the first nine months of this year, the trade deficit was $18.1 billion, compared to $23.5 billion in the same period in 1978. Last year's deficit reached $28.5 billion. If the monthly deficits for October, November and December were as large as September's $2.8 billion, the total for this year would be nearly $32 billion.

As recently as July, the monthly deficit related to oil was only $4.6 billion. Then as the OPEC increases of late June began to be reflected in the price of oil reaching the United States, the August oil deficit widened to $5.1 billion and then on to $5.7 billion last month.

Over the same two-month period, agricultural exports added more than $75 million a month to the credit side of the ledger. However, imports of manufactured goods rose faster than exports, cutting the U.S. surplus in that category to only $343 million last month.

Six of the 10 leading indicators available for September rose and four declined. The largest contributor to the overall rise in the index was the layoff rate in manufacturing, which dropped significantly from its August level. Close behind in importance was a large increase in the number of building permits issued across the country.

But with higher mortgage interest rates squeezing would-be borrowers, experts expect the number of new building permits issued to drop shortly. Further improvement in the layoff rate seems unlikely, in the opinion of most analysts.

Therefore, the strong September showing probably will not be repeated when October figures are available. Even after last month's rise, the index still stands below the level of last March.