16" upper
I definitely agree with Kevin B, 16" gets my vote for optimal carbine barrel length.
That said, if I was building an AR for "long range" shooting (and I am

) I would put a 20" heavy contour barrel on it.
From an AR-15 platform, you lose about 100FPS for every inch you lop off of the barrel. Not only that, but the shorter the barrel, the less accuracy you can expect. A short barrel can still be very accurate, and in fact I believe Les Baer custom makes uppers using 11.5, 14.5 & 16" barrels -Somebody please correct me if I'm wrong. -
The issue is barrel QUALITY. I have a practically new 16" Armalite upper that shoots about as well at 100m as Beltfed's rifle does at 400. That's not the only issue with the gun, but it's safe to say I will never buy any Armalite parts again.
If you want tips on how to build a tack-driver AR-15, you should pm "Catwork." I believe he's made a number of longe range ARs, and recently sold one of them off.
If you do end up going with an "ordinary" upper, you don't need a rail to use a Harris bipod. Harris makes an adapter for AR handguards that costs about $8.00. It screws in to the holes in the handguard & heat shield, and provides a sling swivel to put your bipod onto.
Hope this helps, cheers.
Tim
EDIT!!!!! It's Larue tactical that makes the short uppers. Larue's "Stealth" uppers are available with 12, 16, 18, & 20" barrels, and are a steal at $1200.

(if you live in the states)