Actually, the same code should do it.
Calling the_post_thumbnail_url( 'full' );
inside the loop will return to you the image url. So, if you use something like
<h2 style="background-image:url(<?php the_post_thumbnail_url( 'full' ); ?>)"><?php the_title(); ?></h2>
you should get what you want. Here is the function documentation.
]]>