Here's a step-by-step analysis:
Assign potential $V=0$ to node "-", and potential $V_+$ to node "+". $V_+$ could be either positive or negative, but I'll be assuming positive for definiteness. Clearly, if you compute the line integral $\boldsymbol{E}$ around the circuit, you get a result of 0. I'll use the direction of integration in your question to analyze the elements of that integral. (You could take the opposite sense and get the same result.)
- Resistor. Your integral across the resistor, from node "+" to node "-", is correct, with result $IR$. If $V_+> 0$, the electric field will be parallel to $d \boldsymbol{l}$ and you find $I>0$, meaning current is flowing into the "+" node of the resistor, through the resistor, and out the "-" node.
- Capacitor, integrating from node "-" to node "+". I'll assign the capacitor potential $U_{capacitor} = V_+$, so that the capacitor's "plus" plate (which could have either sign of charge and voltage) is connected to node "+". Now, if $V_+=U_{capacitor}>0$ the electric field in the capacitor will point from the cap's "plus" plate to its "minus" plate, because $\boldsymbol{E} = - \boldsymbol{\nabla} U$ by definition (that is, $\boldsymbol{E}$ points from high $U$ to low $U$). Then, in your integral, the electric field in the capacitor will be anti-parallel to $d \boldsymbol{l}$, and you get a negative result for this contribution: $-U_{capacitor}.
Adding the two pieces, which must sum to 0, you get:
$$ -U_{capacitor} + IR = 0 \text{ , or}\\
U_{capacitor} = IR $$
Finally, by convention one takes $q$ to be the charge on the "plus" plate of the capacitor (here at node "+"), so that $q=C U_{capacitor}$. Then $dq/dt$ represents the charge flowing into the capacitor's "+" node (through the part, and out the "-" node), which is the opposite of the resistor current:
$$ \frac{dq}{dt} = -I $$
Since $q= C U_{capacitor}$, the above loop equation can be re-written as:
$$ \frac{q}{C} = - \frac{dq}{dt} R \text{ , or} \\
\frac{q}{RC} + \frac{dq}{dt} = 0 $$