You may wear contact lenses to correct your myopia. They are not related to the floaters in any way. If you ever develop a sudden shower of new floaters, with or without flashing lights like lightning, you need to be evaluated by an ophthalmologist immediately, since these may be symptoms of a retinal tear/detachment. Myopic people have a higher risk of retinal tears/detachment.
I am just a patient, but know a little about floaters and nearsightedness.
Floaters are usually clumps of cells in the vitreous of the eye (the main 'gel' inside the eyeball). The vitreous is located in front of the retina but behind your eye's natural lens (the lens that usually gets a cataract at some point). It's normal for nearsighted patients to develop floaters as their eye ages.
Although they can be annoying, floaters don't have anything to do with the front surface of your eye where a contact lens sits. So if your eyes are healthy (except for the nearsightedness and floaters) you can wear contact lenses despite your floaters.
The doctor who saw you probably mentioned that you should come back immediately if you see a sudden, new batch of floaters that look like a shower of black dots, a 'swarm of bees' or a black 'curtain' in any part of your vision - or if you see any other sudden change in your vision. Although not common, this could indicate a retinal tear or detachment that would need prompt treatment. People who are nearsighted have more risk for this issue, although the chance this will happen is low.
So, feel free to wear your contacts, under an eye doctor's supervision.