This is the definition of rational map in Harris, AG: a first course.
Def 7.3: $X$ is irreducible variety and $Y$ any variety. $\phi:X\to Y$ is rational if $\phi$ is defined on a dense open set $U$ with the equivalence relation that two functions agrees upon the intersection of their corresponding dense open set(i.e. $\phi_1,U_1$ and $\phi_2,U_2$ agrees on $\phi_1|_{U_1\cap U_2}=\phi_2|_{U_1\cap U_1}$ and this equivalence class defines $\phi$).
I do not see the requirement of dense is necessary. If $X$ is irreducible, then $X=(X-U)\cup\bar{U}$. So $\bar{U}=X$ which is automatic.