Magnetic cable catchers like the MOS Organiser are great, but they’re fdairly expensive considering it’s just a block of magnets. If you’d prefer to make one for yourself, Makeuseof has a guide for doing it with repurposed materials.
In this case, Makeuseof is using a few discarded electronics to grab the magnets and a sheet of metal, but you can buy magnets from craft and hardware stores. The basic process is to cut down a piece of metal, spray paint it, attach the magnets to your cables, and then mount the sheet of metal to you desk with some double-sided tape. Head over to Makeuseof for the full guide.
Build Your Own: MOS Magnetic Cable Organiser [Makeuseof]