You have to make your addon dependent on nUI (as an optional dependency). That (should) cause WoW to load nUI first if it is present.
EDIT: There is another trick you can do...
Code:
if not IsAddOnLoaded( "nUI" ) then
LoadAddOn( "nUI );
end
if IsAddOnLoaded( "nUI" ) then
nUIStuff();
end