We construct an optimal quadrature formula in the sense of Sard in the Hilbert space $K_2(P_3)$. Using Sobolev's method we obtain new optimal quadrature formula of such type and give explicit expressions for the corresponding optimal coefficients. Furthermore, we investigate order of the convergence of the optimal formula and prove an asymptotic optimality of such a formula in the Sobolev space $L_2^{(3)}(0,1)$. The obtained optimal quadrature formula is exact for the trigonometric functions $\sin x$, $\cos x$ and for constants. Also, we include a few numerical examples in order to illustrate the application of the obtained optimal quadrature formula.