Stealth is deactivated automatically when you enter combat. Only your first shot will be able to count as a stealth attack; after the first shot, the enemy is aware of your presence and your stealth is gone.
This isnt like oblivion or skyrim where you can just sit in a dark corner and murder an entire town without anyone ever spotting you.