The gradient of a curve is \(ax + b\) at all points, where \(a\) and \(b\) are constants. Find the equation of the curve, given that it passes through the points \((0,4)\) and \((1,3)\), and that the tangent at \((1,3)\) is parallel to the line \(y = x\).