Create "Floor" plane in cycles?
This feature is now included.

Select the shadowcatcher object, go to the object properties and check Shadow Catcher under Cycles Settings.

It will render a shadow but mask the object behind it.