Take the dense subset to be those irrationals whose binary expansion $a_m 2^m+\cdots+a_n2^n$ is infinite and periodican irrational quadratic for the even powers and infinite and non-periodic for the odd powers. In other words (for alternatives see below) the binary number formed by the coefficients of the even places is rational (in it's infinite form) andirrational quadratic and the odd places irrational.
As observed by Henrik in the comments there are continuity issues mapping directly from $\mathbb{Q}$ so we replace it by any irrational homeomorphic set $\mathbb{Q}'$ which could be the quadratic irrationals as in Todd's answer or simply $\lambda \mathbb{Q}$ for some $\lambda \notin \mathbb{Q}$.
Then the map from M from $\mathbb Q\times \mathbb P$$\mathbb Q'\times \mathbb P$ to a dense subset of $\mathbb R$ given by interleaving the binary expansions should work. More formally $M(q,p)=T_e(q)+T_o(p)$ where $T_e(r)$ and $T_o(r)$ are defined by taking athe binary expansion of $r$ where you must pick the infinite periodic one for the rational case (This is necessary as observed by Henrik in the comments). Then in the binary form you map $2^n\rightarrow 2^{2n}$ and $2^n\rightarrow 2^{2n+1}$ respectively. i.e.
$T_e(11)=T_e(2^0+2^1+2^3)=2^0+2^2+2^6=69$, $T_o(11)=T_e(2^0+2^1+2^3)=2^1+2^3+2^7=138$.
This map is clearly continuous both ways, 1-1 and maps to a dense subset since any real number has an arbitrarily close rational approximation.
There are of course many possible such examples as for any infinite fixed subset S of the integers we can take the dense subset to be those irrational numbers whose binary expansion over $S$ or $\mathbb Z\setminus S$ is infinite and represents a rationalvalue in $\mathbb{Q}'$ or is irrational respectively.