See this, there are many such items. It is of course possible to DIY your own relay with a driver circuit and use a tiny relay if you want the final thing to be smaller.
The Nano nice, you can find clones with no header pins already soldered on for a low profile. There are even smaller ones, but for ease of use I suggest staying with models that have a USB connector on them.
a7