Singular value decomposition (SVD) method and unscented Kalman filter (UKF) are integrated to estimate the attitude and attitude rates of a nanosatellite recursively. First the SVD method minimizes the Wahba's loss function to find the optimal solution for the attitude on the basis of magnetometer and sun sensor vector measurements. Then the UKF uses this attitude information as the measurements for providing more accurate attitude estimates even when the satellite is in eclipse. The "rotation angle error covariance matrix" calculated for the estimations of the SVD method are regarded as the measurement noise covariance for the UKF. Discussions for the UKF tuning are included specifically for the eclipse period where the SVD method fails and practically there is no measurements incoming to the filter.