Wi-Fi speed slows down when connected to a Dell monitor using HDMI and lid is closed

I bought a DELL monitor for my DELL ubuntu laptop. I noticed my wifi connection was much slower than usual, so I spent some time diagnosing my network settings and upgrading the kernel. At the end, it turned out that my connection was slow only when my laptop was connected to my new monitor using HDMI. I also noticed that if the lid is open,there are no wifi problems. This makes me think the issue is not with the HDMI cable itself, but should be a software one.

Please, can anyone point me which settings should I alter in order to fix this issue?