JAKARTA, Indonesia—Sex outside marriage, gay sex and cohabitation of unmarried couples would become illegal in Indonesia and punishable with prison terms under proposals from Islamist political parties whose influence has grown with the popularity of their conservative agenda.

The proposals are part of a draft of a revised criminal code that has been the subject of debate this week between Islamists who seek heavier penalties and more moderate lawmakers who want to restrict the scope and severity of such punishments.

...