If I had an MRI with contrast would that detect and cancerous lymph nodes that are swollen in neck?

Very young for cancer. At your age the lymph nodes in your neck are probably due to a reaction to infection or other inflammation. It is unlikely that they are due to cancer; however, MRI can often detect abnormally enlarged or abnormally shaped lymph nodes.
Yup. If the MRI was of your neck it would detect masses/abnormalities of that kind to a certain size.

Related Questions

Would an MRI withOUT contrast on the brain and neck reveal if lymph nodes in neck are cancerous? Also, would it reveal common brain abnormalities?

MRI brain & neck. Without IV contrast would reveal common brain lesions, and depends on what's the ordering physician is looking for. As for the lymph nodes it would show better resolution than other modalities such as CT, but definitive diagnosis necessitates tissue diagnosis, either a biopsy or fine needle aspiration, good luck. Read more...