I don’t use yafray much so I don’t know about the only shadow thing.
If you want the traditional white background style where it looks like infinite white space like in the Matrix or on some TV adverts, you can do this:
Make a plane for the floor and in the material settings, go into material transp and turn on only shadows. In the world settings, at the opposite end to the lamp buttons, make the environment whatever colour (white is good). Now the plane renders the shadows and the rest is pure white with no shading at the back.
If you want some shading, like in your test image, experiment with the world settings by turning on blend for example and maybe changing the zenith and horizon colours.
The only problem you might encounter here is that extra lamps don’t seem to illuminate shadows unless they cast shadows themselves. That’s because the plane only receives shadows and nothing else. This means that if you only want your object to cast one shadow, it will be pitch black not light grey as in your picture. A way round this is to change the alpha value of the plane material. This lightens your shadows. Some tests gave me this result: