I created a Firefox extension and put its code on GitHub. The code includes the logo of my extension for use as its icon. I created the that logo myself. I want to build my portfolio and thus want to add an Open-Source Licence to it. But I also want to retain my rights to that icon. Is it okay if I just put the MIT Licence in the readme.md file?
When you explicitly want to exclude your logo from the license, you can write so in the copyright file.
It's also not uncommon for larger open source projects to trademark their logos and names. This is not completely uncontroversial in the open source community (it's why Debian is shipped with "Iceweasel" and not "Firefox") but still quite common. While the open source license gives away control of your program, trademark law means you still retain control of the brand.
It is somewhat common for project to handle graphical assets and code differently, and you can release your code under the MIT licence, but not your logo.
It's important to differentiate between copyright and trademark. Both are forms of intellectual property
Copyright protects the artistic expression of a work.
Trademark protects the association of expression with some entity.
For example, the CocaCola Company has a trademark on the name CocaCola. You may not use name CocaCola to refer to your drink. It also has a trademark on its logo. You may not use their logo for your drink.
But you may use their name and their logo to refer to them. There is no possible confusion arising from you using the labels.
It's worth noting that many logos are not eligible for copyright in the US and many other jurisdictions at all: geometric shapes and logos that consist entirely of letters in some font for example are often not. That doesn't change your situation much; attaching a copyright license to something that's not eligible for copyright effectively does nothing, it'll neither help nor hurt you.
When you licence your code under the MIT license, you have a choice to license your logo under the MIT license as well.
Independent of that choice, you may have trademark rights on your logo, and you may have registered that trademark.
When you say
I also want to retain my rights to that icon.
it's pedantry time, and ask which rights to that icon you want to retain exactly.
If you don't want anyone using it, you should not provide a copyright license for it.
If you don't mind people using it, but want to keep it as a trademark, connecting you to that image, you can release it under the MIT.
In either case, you can use and defend it as a (registered or unregistered) trademark.
In either case, you want to mention in a notice or readme file what the copyright status of the entire project is. What the MIT license in your project refers to exactly - the code, some/none of the graphical assets, and explicitly (not) the logo - and who the copyright holders are.