Let me know if I missed anything/anyone!
Top Ten Rated Dramas with an Idol in the Cast 
1. Master's Sun: 17.6% [L of Infinite, minor support]
2. King of Ambition: 16.4% [Yunho of DBSK, MAIN]
3. The Heirs: 16.3% [Minhyuk of CNBlue, main support, Krystal of F(x), main support]
4. Gu Family Book: 15.6% [Suzy of Miss A, MAIN]
5. That Winter, The Wind Blows: 13.2% [Eunji of APink, MAIN]
6. Jeon Woo Chi: 13.1% [Uee of AfterSchool, MAIN, Baek Ho & Ren of NU'EST, minor support]
7. School 2013: 13%*** [Kim Dani and Hyoyoung of 5Dolls, minor support]
8. 7th Grade Civil Servant: 11.6% [Chansung of 2PM, support, Doojoon of B2ST, support]
9. IRIS II: 10.75% [Lee Joon of MBLAQ, MAIN, Hyung Gon of A-JAX, support]
10. When A Man Loves: 10.1% [Jr & JB of JJ Project, minor support]
* viewer ratings taken from average of TNmS Media Korea and AGB Nielsen Korea nationwide averages.
** Public Broadcast Channels only, no cameos included!
*** Final episode had a 15.5% average
**** some dramas started in 2012 but ended in 2013, I Miss You was mostly in 2012.
***** I'm not considering IU and Seo In Guk idols, I wasn't sure about former SS501 members so I left Kim Hyung Jun out too.
****** sometimes it was hard to know how big a role they had but I focused on if they were in main cast, names were bolded, if they were the younger version of someone ect..