Let $\Omega\subset \mathbb{R}^n$ an open contractible set (we can assume $n=2$ for a start) and $\omega$ be a 1-form on $\Omega$ which is nowhere zero. Then $\omega=df$ for a function $f$ if and only if $d\omega=0$. If $\omega$ is not closed it might still be possible that it works up to a positive multiple. In other words, do there exist functions $f,g$ on $\Omega$, $g>0$ such that $df=g\omega$?

For a contractible $\Omega$ this is equivalent to $dg\wedge \omega+gd\omega=0$, and if $h$ denotes the logarithm of $g$, the question is whether there exists $h$ such that $dh\wedge \omega+d\omega=0$. However, this equation does not tell me much.

If the machinery of differential topology has an easy answer to this question I'm also interested what can be said in more general cases (first of all a ring-shaped $\Omega$, or more than 2 dimensions).