Frederic's answer was very close but it left me with one problem: I had more than one dialog on that page, and after I changed the overlay for the one dialog, it changed all of them until the page was reloaded. However, it did give me an idea;
First I stored the default values into variables (page scope), and then set my custom style.
var overlay = $(".ui-widget-overlay");
baseBackground = overlay.css("background");
baseOpacity = overlay.css("opacity");
overlay.css("background", "#000").css("opacity", "1");
Then when the dialog is closed, I restored those values.
$(".ui-widget-overlay").css("background", baseBackground).css("opacity", baseOpacity);
The main reason for storing them in variables (as opposed to resetting them to explicit values) is for maintainability. This way, even if the site.css changes, it will work.
Thanks for your help!