The declaration of "Uno!" just warns all other players that they're down to their last card after this play (as failure to declare this after playing your penultimate card & before the next player plays their card opens you up to being challenged by another player, forcing the failing player to draw 2 cards immediately).
The game only ends if a player has played ALL CARDS from their hand... so the other players have a chance at stopping or delaying the player that's almost out. If that player ever goes above 1 card at any point (as they have to draw a card because they can't play their final card OR gets hit with a draw penalty), they will have to declare "Uno!" again when they get back down to 1 card.
In your scenario... you're playing with ONLY your friend & assuming you're sticking to the official rules (no houserules in play)... You are allowed to play the Wild Draw 4 card, that would allow you to declare your desired color, force your friend to draw 4 cards & give you another turn (as the draw action takes your friend's turn). HOWEVER, you would have to make sure it was the only viable move you have per official rules, as your friend could challenge your play (claiming you had another card you could play). If your friend's challenge is successful (as you could have played a different card), you get hit with the 4 card penalty & your friend takes their turn normally. HOWEVER, if your friend's challenge FAILS (as you couldn't play any other card), their take 6 cards (as there's a 2 card penalty for failed challenges) for the resolve.
When you play that Wild Draw 4 card, your friend can choose to accept the draw (of 4 cards) OR challenge your play. Your friend CANNOT, by official rules, play another Wild Draw 4 NOR play a Draw 2 in your declared color (what's known as "Draw Stacking" HOUSE RULE... which could also be referred to as the "Pain Train").
If that Wild Draw 4 was your penultimate card, you could declare Uno... Force your friend to draw the 4 cards (or 6, if they attempt to challenge) & then play your final card to win the game / round (depending which game variation you're playing).
Hope this helps!