Using "a/an" with uncountable nouns in exclamation sentences
You do omit the "an", indeed because advice is not countable.
"What useful advice you gave me" is correct and totally natural sounding.
You COULD say:
"What a useful piece of advice."
Since a 'piece of advice' is countable. (This isn't the preferred way to express it: Stick with your second example.)
"What great weather today", "We have great weather today", "There's going to be great weather tomorrow" are all correct, because weather is also not countable. Could you see yourself counting the number of weathers?
BONUS SIDE ANSWER:
You use 'a' before useful, not 'an.' Take this sentence:
You gave me a useful calculator for the test.
You are correct that u is a vowel, so normally you would use an. However the rule is a little more complicated than that -- how you decide to use 'a' or 'an' is based on what the word SOUNDS like, not how's it's spelled.
"Useful" starts with the "You" sound, and in this case y is acting as a consonant. Other situations where this is confusing include:
He is an honorable man.
Honorable starts with the "on" sound, and o is a vowel.
This is a union of our peers.
Union, just like useful, starts with the "you" sound, so you use 'a'.
A one-legged chair decorated the foyer.
One is pronounced "won", a w sound, so you use 'a'.