Using uploaded images as CSS background

I would like to use the setStyle() function specifically for background images.
Is there a way to link to the images that have been uploaded as images?

I can only seem to make this work reliably with fully qualified URLs and the full path is pretty nasty to look at, especially after it is packed into a giant string of other CSS.