The nation's farmers began 1989 on a price upswing that saw them receiving more for their cattle, hogs, tomatoes and wheat, according to preliminary January figures by the Agriculture Department.

On the average, prices that farmers got for raw products increased 1.4 percent from December to January, the department's Agricultural Statistics Board said Tuesday.As always, there were losers as well as gainers, with grapefruit, oranges, peanuts and strawberries commanding lower prices. But even so, the USDA's overall price index was up 12 percent from a year earlier.

New quarterly figures showed prices paid by farmers to meet expenses rose 1.2 percent from October and averaged 6.1 percent more than a year ago. Higher prices for feeder stock, including pigs and cattle, along with higher calf prices accounted for most of the rise since last fall.

In a related report, the board said preliminary figures showed last year's corn production, which was shriveled nearly a third by drought and heat, had a value of more than $13 billion, an average of $2.60 per bushel. That was down from almost $14 billion in 1987, when the crop averaged only $1.94 per bushel.

The value is USDA's estimate of how much a crop is worth, whether a farmer sells it for cash or feeds it to livestock.

Soybeans were valued at almost $11.9 billion, an average of $7.70 per bushel, compared with $11.3 billion and $5.88 in 1987. Wheat was third at $6.63 billion and $3.70 per bushel, compared with a 1987 value of $5.5 billion and $2.57 per bushel.

According to the preliminary January price figures, based mostly on midmonth averages, the index for livestock and livestock products as a group rose 1.9 percent from their December average and was up 6.8 percent from January 1988.

The department's all-crops price index for January rose 0.7 percent from December and was up 20 percent from a year earlier. Prices of food grains were up 3.2 percent from December. Wheat prices rose 14 cents per bushel from December to $4.08 in January, the highest since March 1981. Rice dropped 8 cents per 100 pounds to $6.52 per hundredweight.

Prices of commercial vegetables rose 8.2 percent from December, with tomatoes and sweet corn leading the increase.

The all-fruit price index dropped 6.8 percent from December but still averaged 16.2 percent more than in January 1988.

Oranges dropped to $6.20 per box from $6.50 in December but were up from $5.64 a year earlier. Grapefruit declined to $3.72 per box from $4.71 in December and $5.63 in January 1988.

Although the projections are subject to change, USDA economists say that net cash income of farmers may be in the range of $48 billion to $58 billion this year, compared with a near-record of $57 billion in 1988. That is the difference between cash receipts and cash expenses during the calendar year.

Department economists say cash expenses are expected to rise moderately in 1989 with expanded crop acreages and costlier production items.

Food prices in 1988 rose an average of about 3.7 percent, and USDA analysts say another increase of 3 percent to 5 percent is likely in 1989.